﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using PM.Common;
using PM.Entity;
using PM.Services;

namespace PM.Site.Admin
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"] == null || Session["UserTypeId"] == null)
            {
                Response.Redirect("Login.aspx?RequestUrl=" + Request.Url.OriginalString);
            }
            else if (Session["UserTypeId"] != null)
            {
                if (Int32.Parse(Session["UserTypeId"].ToString()) == 1)
                {
                    this.Loading();
                }
                else
                {
                    Response.Redirect("Login.aspx?RequestUrl=" + Request.Url.OriginalString);
                }

            }


        }

        private void Loading()
        {

            if (!Page.IsPostBack)
            {
                DividendCollection dc = DividendServices.GetFutureDividendAnnouncement_HomePage_Collection();
                dlDividends.DataSource = dc;
                dlDividends.DataBind();
            }
        }
    }

}
